home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Utilities / Workspace / WrapperInspector / Source / ImageSubInspector.m < prev    next >
Text File  |  1995-06-12  |  2KB  |  68 lines

  1. //----------------------------------------------------------------------------------------------------
  2. //
  3. //    ImageSubInspector
  4. //
  5. //    Inherits From:        DefaultSubInspector
  6. //
  7. //    Declared In:        ImageSubInspector.h
  8. //
  9. //    Disclaimer
  10. //
  11. //        You may freely copy, distribute and reuse this software and its
  12. //        associated documentation. I disclaim any warranty of any kind, 
  13. //        expressed or implied, as to its fitness for any particular use.
  14. //
  15. //----------------------------------------------------------------------------------------------------
  16. #import "ImageSubInspector.h"
  17. #import "ImageView.h"
  18. #import <appkit/appkit.h>
  19.  
  20.  
  21. @implementation ImageSubInspector
  22.  
  23. static id     _SELF = nil;
  24.  
  25. //----------------------------------------------------------------------------------------------------
  26. //  Initialization and Free Methods
  27. //----------------------------------------------------------------------------------------------------
  28. + new
  29. {
  30.     // Only allow one instance... 
  31.         
  32.         if (_SELF) return _SELF;
  33.         _SELF = self = [super new];
  34.      return _SELF;
  35. }
  36.  
  37.  
  38. //----------------------------------------------------------------------------------------------------
  39. //  Inspection Methods
  40. //----------------------------------------------------------------------------------------------------
  41. - inspect: (STR) path
  42. {
  43.     id        image;
  44.  
  45.     if (! path) return self;
  46.     image = [[NXImage alloc] initFromFile: path];
  47.     if (! image) return [self inspectionError: path];
  48.     [imageView image: image];
  49.     [imageView display];
  50.     [image free];
  51.  
  52.     return self;
  53. }
  54.  
  55. //----------------------------------------------------------------------------------------------------
  56. //  Accessing Inspection View
  57. //----------------------------------------------------------------------------------------------------
  58. - clearInspectorView
  59. {
  60.     //  Clear view...
  61.     
  62.     [imageView image: nil];
  63.     [imageView display];
  64.     return self;
  65. }
  66.  
  67.  
  68. @end